Image Display Method and Electronic Device

ABSTRACT

An image display method applied to fields, including artificial intelligence (AI) and human computer interaction, includes detecting an input operation; displaying an image selection interface on a display in response to the input operation; determining at least one image related to the input operation from a group of associated images in a local memory or a cloud storage; displaying a thumbnail of the at least one image in the image selection interface; hiding another image; detecting a first operation where the first operation selects a first thumbnail in the image selection interface; and performing, on the first thumbnail, a processing procedure corresponding to the input operation.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to Chinese Patent Application No.201910683677.2, filed with China National Intellectual PropertyAdministration on Jul. 26, 2019 and entitled “IMAGE DISPLAY METHOD ANDELECTRONIC DEVICE”, which is incorporated herein by reference in itsentirety.

TECHNICAL FIELD

This application relates to the field of terminal technologies, and inparticular, to an image display method and an electronic device.

BACKGROUND

With progress of terminal technologies, functions of electronic devicesare gradually improved. Taking a mobile phone as an example, an imagephotographing function is one of functions frequently used by users.Therefore, a large quantity of images may be stored in the mobile phone.

However, if a user wants to perform an operation (for example, sharingor deleting) on an image, the user needs to manually search a largequantity of images for the image. Operations are cumbersome, and userexperience is relatively poor.

SUMMARY

This application provides an image display method and an electronicdevice, and the method can help a user quickly locate a target image, sothat user operations are simple.

According to a first aspect, an embodiment of this application providesan image display method. The method may be performed by an electronicdevice. The method includes: detecting an input operation; displaying animage selection interface on a display in response to the inputoperation; determining at least one image related to the input operationfrom a group of associated images in a local memory or a cloud storage;displaying a thumbnail of the at least one image in the image selectioninterface, and hiding another image; detecting a first operation forselecting a first thumbnail in the image selection interface; andperforming, on the first thumbnail, a processing procedure correspondingto the input operation.

In some embodiments, the electronic device may determine the at leastone image associated with the input operation from the group of imagesbased on the input operation. After detecting that a user selects atarget image from the at least one image, the electronic device mayperform, on the target image, the processing procedure corresponding tothe input operation. According to the method, the electronic device mayselect images meeting a condition (related to the input operation) froma large quantity of images, and then the user may search, for the targetimage, the images selected by the electronic device, so that useroperations are simple, and user experience is improved.

In a possible design, the hiding another image includes: hiding an imageother than the at least one image in the group of images.

In some embodiments, the electronic device may determine the at leastone image associated with the input operation from the group of imagesbased on the input operation. When displaying the at least one image,the electronic device may hide the another image in the group of images,to help the user have a view, help the user quickly locate a targetimage, and facilitate user operations.

In a possible design, the electronic device may further display markinginformation. The marking information is used to indicate that the atleast one image is related to the input operation.

In some embodiments, the electronic device may display the markinginformation, to help the user quickly locate a target image andfacilitate user operations.

In a possible design, the displaying marking information includes:displaying the marking information on a thumbnail of each of the atleast one image; or displaying the marking information in a region inwhich the at least one image is not displayed in the image selectioninterface.

It should be understood that the electronic device may display themarking information in any form, provided that the marking informationcan indicate that the at least one image is related to the inputoperation. This is not limited in this embodiment of this application.

In a possible design, the marking information includes one or more of anicon, a text, and an image; or the displaying the marking information ona thumbnail of each of the at least one image includes: highlighting anedge of the thumbnail of each of the at least one image.

It should be understood that the foregoing only lists several examplesof identification information, and does not constitute a limitation.

In a possible design, the group of associated images include a group ofimages including a same photographed object, and/or a group of imageswhose photographing time difference is less than a preset timedifference, and/or a group of images photographed at a same place,and/or a group of images belonging to a same album, and/or a group ofimages including same content but having different resolution, and/or agroup of images obtained after a same image is retouched in differentmanners.

It should be understood that the foregoing descriptions of a group ofimages are only an example, and do not constitute a limitation.

In a possible design, before detecting the input operation, theelectronic device may further preset an associated image of each type ofinput operation.

In some embodiments, the electronic device may preset the associatedimage of each type of input operation. In this way, after detecting theinput operation, the electronic device may determine the at least oneimage corresponding to the input operation. According to the method, theuser does not need to search a large quantity of images for a targetimage, so that user operations are simple, and user experience isimproved.

In a possible design, the input operation is an operation used topublish an image, and the performing, on the first thumbnail, aprocessing procedure corresponding to the input operation includes:performing an image publishing procedure on an image corresponding tothe first thumbnail; or the input operation is an operation used to sendan image to a contact, and the performing, on the first thumbnail, aprocessing procedure corresponding to the input operation includes:sending an image corresponding to the first thumbnail to the contact.

In some embodiments, when detecting an operation used to publish animage, the electronic device displays a thumbnail of at least one imagerelated to the publishing operation. After detecting an operation ofdisplaying a first thumbnail from the thumbnail of the at least oneimage by the user, the electronic device may perform a publishingprocedure on an image corresponding to the first thumbnail.Alternatively, when detecting an operation used to send an image to acontact, the electronic device displays a thumbnail of at least oneimage related to the operation. After detecting an operation ofdisplaying a first thumbnail from the thumbnail of the at least oneimage by the user, the electronic device may send an image correspondingto the first thumbnail to a contact. According to the method, theelectronic device may select, based on an input operation, imagesrelated to the input operation, in other words, the electronic devicemay select, from a large quantity of images, images meeting a conditionto some extent (related to the input operation), and then the user mayselect a target image from the images selected by the electronic device,so that user operations are simple, and user experience is improved.

In a possible design, the determining at least one image related to theinput operation from a group of associated images in a local memory or acloud storage includes: determining an operation type of the inputoperation; and determining, based on the operation type, at least oneimage associated with the operation type.

For example, when the operation type of the input operation is imagepublishing, the electronic device determines an image suitable to bepublished. For another example, when the operation type of the inputoperation is sharing an image with a contact, the electronic devicedetermines an image suitable to be shared with a contact.

In a possible design, the determining an operation type of the inputoperation includes: determining that the input operation is an operationused to publish an image; and the determining, based on the operationtype, at least one image associated with the operation type includes:determining, based on the operation type, at least one image suitable tobe published.

In some embodiments, the electronic device may determine, from arelatively large quantity of images, at least one image suitable to bepublished, and the user does not need to search a large quantity ofimages for a target image, so that user operations are simple, and userexperience is improved.

In a possible design, the determining an operation type of the inputoperation includes: determining that the input operation is an operationof communicating with another contact; and the determining, based on theoperation type, at least one image associated with the operation typeincludes: determining, based on the operation type, at least one imagesuitable to be sent to the another contact.

In some embodiments, the electronic device may determine, from arelatively large quantity of images, at least one image suitable to beshared with a contact, and the user does not need to search a largequantity of images for a target image, so that user operations aresimple, and user experience is improved.

In a possible design, the at least one image suitable to be publishedincludes an image of a same type as an image that has been publishedand/or at least one image that has been retouched for a preset quantityof times.

It should be understood that the foregoing is only an example of animage suitable to be published, and does not constitute a limitation. Inan actual application, the electronic device may determine, in anothermanner, images suitable to be published.

In a possible design, the at least one image suitable to be sent to theanother contact includes an image including the another contact and/oran image of a same type as an image that has been sent to the anothercontact.

It should be understood that the foregoing is only an example of animage suitable to be published, and does not constitute a limitation. Inan actual application, the electronic device may determine, in anothermanner, images suitable to be shared with a contact.

In a possible design, the determining at least one image related to theinput operation from a group of associated images in a local memory or acloud storage includes: determining related information of anapplication to which the input operation relates; and determining, basedon the related information of the application, at least one imageassociated with the related information of the application.

In some embodiments, the electronic device may determine, based on therelated information of the application, the at least one imageassociated with the related information of the application. According tothe method, the user does not need to search a large quantity of imagesfor a target image, so that user operations are simple, and userexperience is improved.

In a possible design, the determining related information of anapplication to which the input operation relates includes: determining atype or a function of the application to which the input operationrelates; and the determining, based on the related information of theapplication, at least one image associated with the related informationof the application includes: determining, based on the type or thefunction of the application, at least one image matching the type or thefunction.

In some embodiments, the electronic device may determine the at leastone image based on the type or the function of the application.According to the method, the user does not need to search a largequantity of images for a target image, so that user operations aresimple, and user experience is improved.

In a possible design, the determining related information of anapplication to which the input operation relates includes: determining ahistorical record of publishing or sharing an image by the applicationto which the input operation relates; and the determining, based on therelated information of the application, at least one image associatedwith the related information of the application includes: determining,based on the historical record of the application, at least one imagematching the historical record.

In some embodiments, the electronic device may determine the at leastone image based on the historical record of the application. Accordingto the method, the user does not need to search a large quantity ofimages for a target image, so that user operations are simple, and userexperience is improved.

In a possible design, the determining at least one image related to theinput operation from a group of associated images in a local memory or acloud storage includes: determining time information corresponding tothe input operation; and determining, based on the time information, atleast one image matching the time information.

In some embodiments, the electronic device may determine the at leastone image based on the time information of the input operation.According to the method, the user does not need to search a largequantity of images for a target image, so that user operations aresimple, and user experience is improved.

In a possible design, the determining at least one image related to theinput operation from a group of associated images in a local memory or acloud storage includes: reading or loading all images in the group ofassociated images from the local memory or the cloud storage; anddetermining the at least one image related to the input operation fromall the images in the group of images; and the displaying a thumbnail ofthe at least one image in the image selection interface, and hidinganother image includes: displaying the thumbnail of the at least oneimage in the image selection interface, and not displaying a thumbnailof the another image in the image selection interface.

In some embodiments, an electronic device may read all the images in thegroup of images from the local memory or the cloud storage, and thenselect the at least one image from all the read images. The electronicdevice may display only the thumbnail of the at least one selected imagein the image selection interface, and not display the thumbnail of theanother image, for example, may discard the another image.

In a possible design, the displaying a thumbnail of the at least oneimage in the image selection interface, and hiding another imageincludes: reading or loading the at least one image from the localmemory or the cloud storage, and displaying the thumbnail of the atleast one image in the image selection interface; and not reading orloading the image other than the at least one image in the group ofimages from the local memory or the cloud storage.

In some embodiments, the electronic device may read only the at leastone image related to the input operation from the local memory or thecloud storage, and not read the another image. Therefore, the electronicdevice may display only the thumbnail of the at least one read image inthe image selection interface, and not display the thumbnail of theanother image.

In a possible design, the displaying a thumbnail of the at least oneimage in the image selection interface, and hiding another imageincludes: preloading the thumbnail of the at least one image from thelocal memory or the cloud storage, and not preloading a thumbnail of theimage other than the at least one image in the group of images; anddisplaying the thumbnail of the at least one image in the imageselection interface.

In some embodiments, the electronic device may not fully load any image,but preload the thumbnail of the at least one image related to the inputoperation without preloading the thumbnail of the another image.Therefore, the electronic device may display only the thumbnail of theat least one preloaded image in the image selection interface, and notdisplay the thumbnail of the another image.

According to a second aspect, an embodiment of this application furtherprovides an electronic device. The electronic device includes a display,at least one processor, and a memory. The memory is configured to storeone or more computer programs, and when the one or more computerprograms stored in the memory are executed by the at least oneprocessor, the electronic device can implement the technical solutionaccording to any one of the first aspect and the possible designs of thefirst aspect.

According to a third aspect, an embodiment of this application furtherprovides an electronic device. The electronic device includesmodules/units that perform the method according to any one of the firstaspect and the possible designs of the first aspect. These modules/unitsmay be implemented by hardware, or may be implemented by hardware byexecuting corresponding software.

According to a fourth aspect, an embodiment of this application furtherprovides a chip. The chip is coupled to a memory in an electronicdevice, and is configured to invoke a computer program stored in thememory and execute the technical solution according to any one of thefirst aspect and the possible designs of the first aspect in embodimentsof this application. In this embodiment of this application, “coupling”means that two components are directly or indirectly combined with eachother.

According to a fifth aspect, an embodiment of this application furtherprovides a computer-readable storage medium. The computer-readablestorage medium includes a computer program. When the computer program isrun on an electronic device, the electronic device is enabled to performthe technical solution in any one of the first aspect of the embodimentsof this application or the possible designs of the first aspect.

According to a sixth aspect, an embodiment of this application providesa program product, including instructions. When the program product isrun on an electronic device, the electronic device is enabled to performthe technical solution in any one of the first aspect of the embodimentsof this application or the possible designs of the first aspect.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1A is a schematic diagram of a hardware structure of a mobile phone100 according to an embodiment of this application;

FIG. 1B is a schematic diagram of a software architecture of a mobilephone 100 according to an embodiment of this application.

FIG. 2A (a) to FIG. 2A (c) are schematic diagrams of graphical userinterfaces of a mobile phone 100 according to an embodiment of thisapplication;

FIG. 2B (a) to FIG. 2B (d) are schematic diagrams of graphical userinterfaces of a mobile phone 100 according to an embodiment of thisapplication;

FIG. 3A (a) to FIG. 3A (d) are schematic diagrams of graphical userinterfaces of a mobile phone 100 according to an embodiment of thisapplication;

FIG. 3B (a) to FIG. 3B (e) are schematic diagrams of graphical userinterfaces of a mobile phone 100 according to an embodiment of thisapplication;

FIG. 4A (a) to FIG. 4A (c) are schematic diagrams of graphical userinterfaces of a mobile phone 100 according to an embodiment of thisapplication;

FIG. 4B (a) to FIG. 4B (d) are schematic diagrams of graphical userinterfaces of a mobile phone 100 according to an embodiment of thisapplication;

FIG. 5A (a) and FIG. 5A (b) are schematic diagrams of graphical userinterfaces of a mobile phone 100 according to an embodiment of thisapplication;

FIG. 5B (a) to FIG. 5B (c) are schematic diagrams of graphical userinterfaces of a mobile phone 100 according to an embodiment of thisapplication;

FIG. 6 is a schematic flowchart of an image classification methodaccording to an embodiment of this application;

FIG. 7 is a schematic diagram of a model according to an embodiment ofthis application;

FIG. 8 is a schematic flowchart of model training according to anembodiment of this application;

FIG. 9A is a schematic diagram of graphical user interfaces of a mobilephone 100 according to an embodiment of this application;

FIG. 9B is a schematic diagram of graphical user interfaces of a mobilephone 100 according to an embodiment of this application;

FIG. 9C is a schematic diagram of graphical user interfaces of a mobilephone 100 according to an embodiment of this application;

FIG. 9D is a schematic diagram of graphical user interfaces of a mobilephone 100 according to an embodiment of this application; and

FIG. 10 is a schematic flowchart of an image display method according toan embodiment of this application.

DESCRIPTION OF EMBODIMENTS

The following clearly and completely describes the technical solutionsin the embodiments of this application with reference to theaccompanying drawings in the embodiments of this application.Apparently, the described embodiments are merely some but not all of theembodiments of this application. All other embodiments obtained bypersons of ordinary skill in the art based on the embodiments of thisapplication without creative efforts shall fall within the protectionscope of this application.

In the following, some terms of the embodiments of this application aredescribed, to help persons skilled in the art have a betterunderstanding.

An application (application, app for short) in this embodiment of thisapplication is a software program that can implement one or morespecific functions. Generally, a plurality of applications can beinstalled on a terminal, such as a camera application, a galleryapplication, a short message application, a multimedia messageapplication, various email applications, WeChat (WeChat), a Tencent chatsoftware (QQ), WhatsApp Messenger, Line (Line), Instagram (instagram),Kakao Talk, and DingTalk. The application mentioned in the following maybe an application installed when the terminal is delivered from afactory, or may be an application downloaded by a user from a network orobtained by the user from another terminal in a process of using theterminal.

A social application (or referred to as a social platform) in theembodiments of this application is an application that can implementcontent (for example, an image or a text) sharing. For example, thesocial application is Facebook (facebook), Twitter (twitter), Weibo,WeChat, Instagram, Zhihu, Linkedin, Douban, Tianya, and Xiaohongshu.

An image selection interface (which may also be referred to as aninterface for selecting an image) in the embodiments of this applicationis an interface that can display thumbnails of a plurality of images forselection by a user, for example, an interface 203 in FIG. 2B (a) toFIG. 2B (d) or an interface 305 in FIG. 3B (a) to FIG. 3B (e) below.

A thumbnail in the embodiments of this application is an incompleteimage that is of an image and that is made for ease of browsing of auser or for displaying more images. The incomplete image may be an imageobtained by compressing an image, or an image obtained by reducing asize of an image, or an image obtained by sampling some pixels on animage, or an image that displays only a part of content of an image, oran image stored on the cloud, where a blurred outline of the image canbe locally displayed (an image that has not been downloaded from thecloud). For example, thumbnails may be displayed in the interface 203 inFIG. 2B (a) to FIG. 2B (d) or the interface 305 in FIG. 3B (a) to FIG.3B (e), and a user selects an image from the thumbnails.

“A plurality of” in the embodiments of this application indicates “twoor more”.

It should be noted that, the term “and/or” in this specificationdescribes only an association relationship between associated objectsand represents that three relationships may exist. For example, A and/orB may represent the following three cases: Only A exists, both A and Bexist, and only B exists. In addition, unless otherwise specified, thecharacter “/” in this specification generally indicates an “or”relationship between the associated objects. In the descriptions of theembodiments of this application, terms such as “first” and “second” areonly used for distinction and description, but cannot be understood asindication or implication of relative importance, and cannot beunderstood as an indication or implication of a sequence.

The following describes the electronic device, a graphical userinterface (graphical user interface, GUI) used for such an electronicdevice, and embodiments for using such an electronic device. In someembodiments of this application, the electronic device may be a portableterminal including a display, for example, a mobile phone or a tabletcomputer. An example embodiment of the portable electronic deviceincludes but is not limited to a portable electronic device using iOS®,Android®, Microsoft®, or another operating system. The foregoingportable electronic device may be another portable electronic devicesuch as a digital camera. It should be further understood that, in someother embodiments of this application, the electronic device may not bea portable electronic device, but is a desktop computer or the like witha display.

Generally, the electronic device supports a plurality of applications,for example, one or more of the following applications: a cameraapplication, an instant messaging application, and a photo managementapplication. There may be a plurality of instant messaging applicationssuch as WeChat (Wechat), Weibo, Tencent chat software (QQ), WhatsAppMessenger, Line (Line), Instagram (instagram), Kakao Talk, and Dingtalk.The user may send information such as text, voice, an image, a videofile, and another file to another contact (or another contact) throughthe instant messaging application. Alternatively, the user may implementa video call or a voice call with another contact through the instantmessaging application.

For example, the electronic device is a mobile phone. FIG. 1A is aschematic diagram of a structure of a mobile phone 100.

The mobile phone 100 may include a processor 110, an external memoryinterface 120, an internal memory 121, a universal serial bus (universalserial bus, USB) interface 130, a charging management module 140, apower management module 141, a battery 142, an antenna 1, an antenna 2,a mobile communications module 150, a wireless communications module160, an audio module 170, a speaker 170A, a receiver 170B, a microphone170C, a headset jack 170D, a sensor module 180, a button 190, a motor191, an indicator 192, a camera 193, a display 194, a subscriberidentification module (subscriber identification module, SIM) cardinterface 195, and the like. The sensor module 180 may include apressure sensor 180A, a gyroscope sensor 180B, a barometric pressuresensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, arange sensor 180F, an optical proximity sensor 180G, a fingerprintsensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambientlight sensor 180L, a bone conduction sensor 180M, and the like.

The processor 110 may include one or more processing units. For example,the processor 110 may include an application processor (applicationprocessor, AP), a modem processor, a graphics processing unit (graphicsprocessing unit, GPU), an image signal processor (image signalprocessor, ISP), a controller, a memory, a video codec, a digital signalprocessor (digital signal processor, DSP), a baseband processor, aneural-network processing unit (neural-network processing unit, NPU),and/or the like. Different processing units may be independentcomponents, or may be integrated into one or more processors.

The controller may be a nerve center and a command center of the mobilephone 100. The controller may generate an operation control signal basedon instruction operation code and a time sequence signal, to completecontrol of instruction fetching and instruction execution. A memory mayfurther be disposed in the processor 110, and is configured to storeinstructions and data. In some embodiments, the memory in the processor110 is a cache memory. The memory may store instructions or data justused or cyclically used by the processor 110. If the processor 110 needsto use the instructions or the data again, the processor 110 maydirectly invoke the instructions or the data from the memory. Thisavoids repeated access and reduces waiting time of the processor 110.Therefore, system efficiency is improved.

The processor 100 may run the software code of an image sharingalgorithm provided in the embodiments of this application, to implementan image sharing process.

The USB interface 130 is an interface that conforms to a USB standardspecification, and may be specifically a mini USB interface, a micro USBinterface, a USB type-C interface, or the like. The USB interface 130may be configured to connect to a charger to charge the mobile phone100, and may be configured to transmit data between the mobile phone 100and a peripheral device.

The charging management module 140 is configured to receive a charginginput from the charger. The power management module 141 is configured toconnect to the battery 142, the charging management module 140, and theprocessor 110. The power management module 141 receives an input fromthe battery 142 and/or the charging management module 140, and suppliespower to the processor 110, the internal memory 121, an external memory,the display 194, the camera 193, the wireless communications module 160,and the like.

A wireless communications function of the mobile phone 100 may beimplemented through the antenna 1, the antenna 2, the mobilecommunications module 150, the wireless communications module 160, themodem processor, the baseband processor, and the like.

The antenna 1 and the antenna 2 are configured to transmit and receivean electromagnetic wave signal. Each antenna in the mobile phone 100 maybe configured to cover one or more communications frequency bands.Different antennas may further be multiplexed, to improve antennautilization. For example, the antenna 1 may be multiplexed as adiversity antenna in a wireless local area network. In some otherembodiments, the antenna may be used in combination with a tuningswitch.

The mobile communications module 150 may provide a solution, applied tothe mobile phone 100, to wireless communication including 2G/3G/4G/5Gand the like. The mobile communications module 150 may include at leastone filter, a switch, a power amplifier, a low noise amplifier (lownoise amplifier, LNA), and the like. The mobile communications module150 may receive an electromagnetic wave through the antenna 1, performprocessing such as filtering or amplification on the receivedelectromagnetic wave, and transmit a processed electromagnetic wave to amodem processor for demodulation. The mobile communications module 150may further amplify a signal modulated by the modem processor, andconvert the signal into an electromagnetic wave for radiation throughthe antenna 1. In some embodiments, at least some function modules ofthe mobile communications module 150 may be disposed in the processor110. In some embodiments, at least some function modules of the mobilecommunications module 150 and at least some modules of the processor 110may be disposed in a same device.

The wireless communications module 160 may provide a solution, appliedto the mobile phone 100, to wireless communication including wirelesslocal area networks (wireless local area networks, WLAN) (for example, awireless fidelity (wireless fidelity, Wi-Fi) network), Bluetooth(Bluetooth, BT), a global navigation satellite system (global navigationsatellite system, GNSS), frequency modulation (frequency modulation,FM), a near field communication (near field communication, NFC)technology, an infrared (infrared, IR) technology, and the like. Thewireless communications module 160 may be one or more devices thatintegrate at least one communication processing module. The wirelesscommunications module 160 receives an electromagnetic wave through theantenna 2, performs frequency modulation and filtering processing on theelectromagnetic wave signal, and sends a processed signal to theprocessor 110. The wireless communications module 160 may furtherreceive a to-be-sent signal from the processor 110, perform frequencymodulation and amplification on the signal, and convert a processedsignal into an electromagnetic wave for radiation through the antenna 2.

In some embodiments, in the mobile phone 100, the antenna 1 and themobile communications module 150 are coupled, and the antenna 2 and thewireless communications module 160 are coupled, so that the mobile phone100 can communicate with a network and another device by using awireless communications technology. The wireless communicationstechnology may include a global system for mobile communications (globalsystem for mobile communications, GSM), a general packet radio service(general packet radio service, GPRS), code division multiple access(code division multiple access, CDMA), wideband code division multipleaccess (wideband code division multiple access, WCDMA), time-divisioncode division multiple access (time-division code division multipleaccess, TD-SCDMA), long term evolution (long term evolution, LTE), BT, aGNSS, a WLAN, NFC, FM, an IR technology, and/or the like. The GNSS mayinclude a global positioning system (global positioning system, GPS), aglobal navigation satellite system (global navigation satellite system,GLONASS), a BeiDou navigation satellite system (beidou navigationsatellite system, BDS), a quasi-zenith satellite system (quasi-zenithsatellite system, QZSS), satellite based augmentation systems (satellitebased augmentation systems, SBAS), and/or the like.

The mobile phone 100 implements a display function by using the GPU, thedisplay 194, the application processor, and the like. The GPU is amicroprocessor for image processing, and is connected to the display 194and the application processor. The GPU is configured to performmathematical and geometric calculation, and render an image. Theprocessor 110 may include one or more GPUs that execute programinstructions to generate or change display information.

The display 194 is configured to display an image, a video, and thelike. The display 194 includes a display panel. The display panel may bea liquid crystal display (liquid crystal display, LCD), an organiclight-emitting diode (organic light-emitting diode, OLED), anactive-matrix organic light emitting diode (active-matrix organic lightemitting diode, AMOLED), a flexible light-emitting diode (flexlight-emitting diode, FLED), a mini-LED, a micro-LED, a micro-OLED,quantum dot light emitting diodes (quantum dot light emitting diodes,QLEDs), or the like. In some embodiments, the mobile phone 100 mayinclude one or N displays 194, where N is a positive integer greaterthan 1.

The camera 193 is configured to capture a static image or a video. Thecamera 193 may include a front-facing camera and a rear-facing camera.

The internal memory 121 may be configured to store computer-executableprogram code. The executable program code includes instructions. Theprocessor 110 runs the instructions stored in the internal memory 121,to perform various function applications of the mobile phone 100 anddata processing. The internal memory 121 may include a program storagearea and a data storage area. The program storage area may store anoperating system, software code of at least one application (such as acamera application or a WeChat application), and the like. The datastorage area may store data (for example, an image or a video) generatedin a use process of the mobile phone 100. In addition, the internalmemory 121 may include a high-speed random access memory, and mayfurther include a nonvolatile memory, for example, at least one magneticdisk storage device, a flash memory device, or a universal flash storage(universal flash storage, UFS).

The internal memory 121 may further store software code of an imagesharing method provided in the embodiments of this application. When theprocessor 110 runs the software code, procedure steps of the imagesharing method are performed to implement an image sharing process.

The internal memory 121 may further store a class label and the like ofa photographed image, model, or picture.

The external memory interface 120 may be configured to connect to anexternal storage card such as a micro SD card, to extend a storagecapability of the mobile phone 100. The external storage cardcommunicates with the processor 110 through the external memoryinterface 120, to implement a data storage function. For example, filessuch as music and a video are stored in the external storage card.

Certainly, software code of an image sharing method provided in theembodiments of this application may be alternatively stored in anexternal memory. The processor 110 may run the software code by usingthe external memory interface 120, to perform procedure steps of theimage sharing method to implement an image sharing process. A classlabel and the like of an image, a model, or an image photographed by themobile phone 100 may be alternatively stored in the external memory.

It should be understood that a user may specify whether to store animage in the internal memory 121 or the external memory. For example,when the mobile phone 100 is currently connected to the external memory,if the mobile phone 100 photographs an image, prompt information may popup to indicate the user to determine whether to store the image in theexternal memory or the internal memory 121. Certainly, there is anotherspecifying manner, and this is not limited in this embodiment of thisapplication. Alternatively, when detecting that a memory amount of theinternal memory 121 is less than a preset amount, the mobile phone 100may automatically store an image in the external memory.

The mobile phone 100 may implement an audio function such as musicplaying or recording by using the audio module 170, the speaker 170A,the receiver 170B, the microphone 170C, the headset jack 170D, theapplication processor, and the like.

The pressure sensor 180A is configured to sense a pressure signal, andmay convert the pressure signal into an electrical signal. In someembodiments, the pressure sensor 180A may be disposed on the display194.

The gyroscope sensor 180B may be configured to determine a movingposture of the mobile phone 100. In some embodiments, an angularvelocity of the mobile phone 100 around three axes (namely, x, y, and zaxes) may be determined by using the gyroscope sensor 180B. Thegyroscope sensor 180B may be configured to implement image stabilizationduring photographing.

The barometric pressure sensor 180C is configured to measure barometricpressure. In some embodiments, the mobile phone 100 calculates analtitude by using the barometric pressure measured by the barometricpressure sensor 180C, to assist in positioning and navigation.

The magnetic sensor 180D includes a Hall sensor. The mobile phone 100may detect opening and closing of a flip leather case by using themagnetic sensor 180D. In some embodiments, when the mobile phone 100 isa clamshell phone, the mobile phone 100 may detect opening and closingof a flip cover based on the magnetic sensor 180D. Further, a featuresuch as automatic unlocking upon opening of the flip cover is set basedon a detected opening or closing state of the leather case or a detectedopening or closing state of the flip cover.

The acceleration sensor 180E may detect values of acceleration invarious directions (usually on three axes) of the mobile phone 100. Whenthe mobile phone 100 is static, a value and a direction of gravity maybe detected. The acceleration sensor 180E may be further configured toidentify a posture of the electronic device, and is applied to anapplication such as switching between landscape mode and portrait modeand a pedometer.

The range sensor 180F is configured to measure a distance. The mobilephone 100 may measure a distance through infrared light or a laser. Insome embodiments, in a photographing scenario, the mobile phone 100 maymeasure a distance by using the distance sensor 180F, to implement fastfocusing.

The optical proximity sensor 180G may include, for example, alight-emitting diode (LED) and an optical detector, for example, aphotodiode. The light-emitting diode may be an infrared light-emittingdiode. The mobile phone 100 emits infrared light through thelight-emitting diode. The mobile phone 100 detects infrared reflectedlight from a nearby object by using the photodiode. When sufficientreflected light is detected, the mobile phone 100 may determine thatthere is an object near the mobile phone 100. When insufficientreflected light is detected, the mobile phone 100 may determine thatthere is no object near the mobile phone 100. The mobile phone 100 maydetect, by using the optical proximity sensor 180G, that the user holdsthe mobile phone 100 close to an ear to make a call, so as toautomatically turn off a screen for power saving. The optical proximitysensor 180G may also be used in a smart cover mode or a pocket mode toautomatically perform screen unlocking or locking.

The ambient light sensor 180L is configured to sense ambient lightbrightness. The mobile phone 100 may adaptively adjust brightness of thedisplay 194 based on the sensed ambient light brightness. The ambientlight sensor 180L may also be configured to automatically adjust a whitebalance during photographing. The ambient light sensor 180L may alsocooperate with the optical proximity sensor 180G to detect whether themobile phone 100 is in a pocket to prevent an accidental touch.

The fingerprint sensor 180H is configured to collect a fingerprint. Themobile phone 100 may use a feature of the collected fingerprint toimplement fingerprint unlocking, application lock access,fingerprint-based photographing, fingerprint-based call answering, andthe like.

The temperature sensor 180J is configured to detect a temperature. Insome embodiments, the mobile phone 100 executes a temperature processingpolicy based on the temperature detected by the temperature sensor 180J.For example, when the temperature reported by the temperature sensor180J exceeds a threshold, the mobile phone 100 lowers performance of aprocessor near the temperature sensor 180J, to reduce power consumptionfor thermal protection. In some other embodiments, when the temperatureis lower than another threshold, the mobile phone 100 heats the battery142 to prevent the mobile phone 100 from being shut down abnormally dueto a low temperature. In some other embodiments, when the temperature islower than still another threshold, the mobile phone 100 boosts anoutput voltage of the battery 142 to avoid abnormal shutdown caused by alow temperature.

The touch sensor 180K is also referred to as a “touch panel”. The touchsensor 180K may be disposed on the display 194, and the touch sensor180K and the display 194 form a touchscreen, which is also referred toas a “touch screen”. The touch sensor 180K is configured to detect atouch operation on or near the touch sensor 180K. The touch sensor maytransfer the detected touch operation to the application processor, todetermine a type of a touch event. The display 194 may provide a visualoutput related to the touch operation. In some other embodiments, thetouch sensor 180K may alternatively be disposed on a surface of themobile phone 100 at a location different from that of the display 194.

The bone conduction sensor 180M may obtain a vibration signal. In someembodiments, the bone conduction sensor 180M may obtain a vibrationsignal of a vibration bone of a human voice part. The bone conductionsensor 180M may also be in contact with a human pulse, and receive ablood pressure beating signal.

The button 190 includes a power button, a volume button, and the like.The button 190 may be a mechanical button, or may be a touch button. Themobile phone 100 may receive a button input, and generate a buttonsignal input related to user setting and function control of the mobilephone 100.

The motor 191 may generate a vibration prompt. The motor 191 may beconfigured to provide an incoming call vibration prompt or a touchvibration feedback. For example, touch operations performed on differentapplications (for example, a photographing application and an audioplaying application) may correspond to different vibration feedbackeffects.

The indicator 192 may be an indicator light, and may be configured toindicate a charging status and a power change, or may be configured toindicate a message, a missed call, a notification, and the like.

The SIM card interface 195 is configured to connect to a SIM card. TheSIM card may be inserted into the SIM card interface 195 or removed fromthe SIM card interface 195, to implement contact with or separation fromthe mobile phone 100.

It may be understood that the structure shown in this embodiment of thisapplication does not constitute a specific limitation on the mobilephone 100. In some other embodiments of this application, the mobilephone 100 may include more or fewer components than those shown in thefigure, or some components may be combined, or some components may besplit, or there may be a different component layout. The componentsshown in the figure may be implemented by hardware, software, or acombination of software and hardware.

It should be noted that in the conventional technology, the mobile phone100 stores a large quantity of images. When detecting an input operation(for example, an operation used to publish an image or an operation usedto send an image to another contact), the mobile phone 100 displaysthumbnails of all images. The user needs to select a thumbnail of atarget image from the large quantity of thumbnails. Operations arecumbersome. In addition, the thumbnail usually cannot clearly displayimage content. Therefore, the user cannot accurately select thethumbnail of the target image with naked eyes, and the user usuallyneeds to tap a thumbnail of an image to display the image, then slidethe image left or right to display another image, and finally select thetarget image. Operations are cumbersome, and user experience isrelatively poor.

In this embodiment of this application, the mobile phone 100 may analyzeoperation behaviors of the user on images, and classify the images intodifferent image types based on the operation behaviors. For example, themobile phone 100 classifies the images into image types of “you like”and “you dislike”, image types of “suitable to be published” and“unsuitable to be published”, or image types of “suitable to be sent toanother contact” and “unsuitable to be sent to another contact”. Whendetecting an operation used to publish an image, the mobile phone 100may recommend an image of “you like” or “suitable to be published” tothe user. When detecting an operation used to send an image to anothercontact, the mobile phone 100 may recommend an image of “you like” or animage of “suitable to be sent to another contact” to the user.Therefore, the mobile phone 100 may recommend, based on an inputoperation of the user, an image related to the input operation, andthere is no need to search a large quantity of images for an image, sothat user operations are simple.

In some embodiments, a software system of the mobile phone 100 may use ahierarchical architecture, an event-driven architecture, a micronucleusarchitecture, a microservice architecture, or a cloud architecture. AnAndroid (Android) system of the hierarchical architecture is used as anexample in the following embodiments to describe a software structure ofthe mobile phone 100.

FIG. 1B is a block diagram of the software structure of the mobile phone100 according to an embodiment of this application. In the layeredarchitecture, software is divided into several layers, and each layerhas a clear role and task. The layers communicate with each otherthrough a software interface. In some embodiments, the Android system isdivided into four layers: an application layer, an application frameworklayer, an Android runtime (Android runtime) and system library, and akernel layer from top to bottom. The application layer may include aseries of application packages. As shown in FIG. 1B, the applicationpackage may include applications such as “camera”, “gallery”,“calendar”, “phone”, “map”, “navigation”, “WLAN”, “Bluetooth”, “music”,“video”, and “messages”. The application framework layer provides anapplication programming interface (application programming interface,API) and a programming framework for an application at the applicationlayer. The application framework layer includes some predefinedfunctions.

As shown in FIG. 1B, the application framework layer may include awindow manager, a content provider, a view system, a phone manager, aresource manager, a notification manager, and the like. The windowmanager is configured to manage a window program. The window manager mayobtain a size of a display, determine whether there is a status bar,perform screen locking, take a screenshot, and the like. The contentprovider is configured to store and obtain data, and enable the data tobe accessed by an application. The data may include a video, an image,audio, calls that are made and received, a browsing historical recordand bookmarks, a phone book, and the like. The view system includesvisual controls, such as a control for displaying a text and a controlfor displaying an image. The view system may be configured to constructan application. A display interface may include one or more views. Forexample, a display interface including an SMS message notification iconmay include a text display view and an image display view. The phonemanager is configured to provide a communication function of the mobilephone 100, for example, management of a call status (including answeringor declining a call). The resource manager provides various resourcesfor an application, such as a localized character string, an icon, animage, a layout file, and a video file. The notification manager enablesan application to display notification information in a status bar, andmay be configured to convey a notification message. The notificationmanager may automatically disappear after a short pause without userinteraction. For example, the notification manager is configured tonotify download completion, provide a message notification, and thelike. The notification manager may alternatively be a notification thatappears in a top status bar of the system in a form of a graph or ascroll bar text, for example, a notification of an application runningon the background or a notification that appears on the screen in a formof a dialog window. For example, text information is displayed in thestatus bar, an alert sound is played, the electronic device vibrates, orthe indicator light blinks.

The Android runtime includes a kernel library and a virtual machine. TheAndroid runtime is responsible for scheduling and management of theAndroid system. The kernel library includes two parts: a function thatneeds to be invoked in Java language and a kernel library of Android.The application layer and the application framework layer run on thevirtual machine. The virtual machine executes Java files at theapplication layer and the application framework layer as binary files.The virtual machine is configured to perform functions such as objectlifecycle management, stack management, thread management, security andexception management, and garbage collection.

The system library may include a plurality of function modules, forexample, a surface manager (surface manager), media libraries (MediaLibraries), a three-dimensional graphics processing library (forexample, OpenGL ES), and a 2D graphics engine (for example, SGL). Thesurface manager is configured to manage a display subsystem and providefusion of 2D and 3D layers for a plurality of applications. The medialibrary supports playback and recording of a plurality of commonly usedaudio and video formats, static image files, and the like. The medialibrary may support a plurality of audio and video coding formats, forexample, MPEG-4, H.264, MP3, AAC, AMR, JPG, and PNG. Thethree-dimensional graphics processing library is configured to implementthree-dimensional graphics drawing, image rendering, composition, layerprocessing, and the like. The 2D graphics engine is a drawing engine for2D drawing.

The kernel layer is a layer between hardware and software. The kernellayer includes at least a display driver, a camera driver, an audiodriver, and a sensor driver.

In this embodiment of this application, refer to FIG. 1B. The systemlibrary may further include an image processing library. When detectingoperation behaviors on images, the image processing library may classifythe images. For example, when detecting an operation behavior on atleast one image in a group of associated images, the image processinglibrary classifies the at least one image. When detecting an inputoperation again, the image processing library may determine at least oneimage related to the input operation from a group of associated images,and recommend the at least one image.

For ease of understanding, a mobile phone having the structures shown inFIG. 1A and FIG. 1B is used as an example in the following embodimentsof this application, and the display method provided in the embodimentsof this application is specifically described with reference to theaccompanying drawings. The following describes an implementation processof the technical solutions of this application by using differentapplication scenarios.

Scenario 1: Gallery Application

As shown in FIG. 2A (a), a mobile phone 100 displays a home screen 201,and the home screen 201 includes application icons of a plurality ofapplications (a camera application, the gallery application, a WeChatapplication, and the like). When the mobile phone 100 detects anoperation of triggering an icon 202 of the gallery application by auser, the mobile phone 100 displays an interface 203 of the galleryapplication, as shown in FIG. 2A (b).

As shown in FIG. 2A (b), the mobile phone 100 displays the interface 203of the gallery application, and the interface 203 includes a thumbnailof an image stored in the mobile phone 100. Thumbnails of three imagesare used as an example in FIG. 2A (b).

In an example, a mark is displayed on a thumbnail of an image of “youlike”, and the mark is used to indicate that the image belongs to theimage type of “you like”. In other words, an image whose thumbnailincludes a mark belongs to the image type of “you like”, and an imagethat does not include a mark belongs to an image type of “you dislike”.As shown in FIG. 2A (b), a mark 207 is displayed on an image 204, and amark 208 is displayed on an image 206. In other words, the image 204 andthe image 206 belong to the image type of “you like”.

For example, when detecting an operation of triggering the mark 207 bythe user, the mobile phone 100 displays prompt information. The promptinformation is used to indicate, to the user, that the image 204 is animage the user likes. As shown in FIG. 2A (c), the mobile phone 100 mayfurther display an “OK” control and a “cancel” control. When the “OK”control is triggered, the mobile phone 100 determines that the image 204belongs to the type of “you like”. When the “cancel” control istriggered, the mobile phone 100 determines that the image 204 does notbelong to the type of “you like”, and cancels display of the mark 207 onthe image 204.

In other examples, as shown in FIG. 2B (a), an edge of a thumbnail of animage of “you like” is bold, and an edge of a thumbnail of another imageis not bold. In other examples, a size of a thumbnail of an image of“you like” is relatively large, and a size of a thumbnail of anotherimage is relatively small. For example, as shown in FIG. 2B (b), sizesof the thumbnail 204 and the thumbnail 206 are greater than a size of athumbnail 205. In other examples, as shown in FIG. 2B (c), the interface203 of the gallery application includes a “classify images” control 210.When the control 210 is triggered, the mobile phone 100 displays aplurality of options. As shown in FIG. 2B (d), the mobile phone 100displays an “image you like” option 211, a “favorite image” option 212,an “image suitable to be published” option 213, and an “image suitableto be sent to another contact” option 214. Assuming that the option 211is selected, the mobile phone 100 displays only an image of “you like”.As shown in FIG. 2B (d), only the image 204 and the image 206 aredisplayed.

In Scenario 1, different identification information is displayed fordifferent types of images in the interface of the gallery application,so that the user can quickly search for an image. In addition, types ofimages are obtained by the mobile phone 100 by performing classificationbased on operation behaviors of the user on the images. Therefore, imagetype classification complies with an operation habit of the user, sothat user experience is improved.

Scenario 2: Social Platform

As shown in FIG. 3A (a), a mobile phone 100 displays an interface 301 ofa WeChat application, and the interface 301 includes a control 302. Whenthe control 302 is triggered, the mobile phone 100 displays a“photograph” option 303 and a “select an image from the gallery” option304, as shown in FIG. 3A (b).

When the mobile phone 100 detects that the “select an image from thegallery” option 304 is selected, the mobile phone 100 displays aninterface 305 for selecting an image, as shown in FIG. 3A (c). Theinterface 305 for selecting an image includes one or more images.

In an example, as shown in FIG. 3A (c), the interface 305 for selectingan image includes thumbnails of a plurality of images in the gallery inthe mobile phone 100. A mark may be displayed on a thumbnail of an imageof “you like”, and an image whose thumbnail does not include a mark isan image of “you dislike”. Alternatively, the interface 305 forselecting an image includes thumbnails of a plurality of images in thegallery in the mobile phone 100. A mark is displayed on a thumbnail ofan image of “suitable to be published”, and a mark is not displayed on athumbnail of an image of “unsuitable to be published”. Alternatively,the interface 305 for selecting an image includes thumbnails of aplurality of images in the gallery in the mobile phone 100. A first markis displayed on a thumbnail of an image of “you like”, a second mark isdisplayed on a thumbnail of an image of “suitable to be published”, andthe first mark is different from the second mark.

As shown in FIG. 3A (c), marks are displayed on thumbnails of an image306 and an image 308. In other words, the image 306 and the image 308are images of “you like” or images of “suitable to be published”. Whendetecting that the image 308 is selected, the mobile phone 100 displaysan interface shown in FIG. 3A (d).

In other examples, as shown in FIG. 3B (a), in the interface 305 forselecting an image, a size of a thumbnail (for example, the image 306and the image 308) of an image of “you like” or an image of “suitable tobe published” is greater than a size of a thumbnail of another image(for example, an image 307).

For another example, as shown in FIG. 3B (b), in the interface 305 forselecting an image, an edge of a thumbnail (the image 306 and the image308) of an image of “you like” or an image of “suitable to be published”is bold.

For another example, as shown in FIG. 3B (c), the interface 305 forselecting an image includes only two thumbnails of images. The twoimages are images of “you like” or images of “suitable to be published”or an image of “you like” and an image of “suitable to be published”selected by the mobile phone 100 from a large quantity of images in thegallery. In this example, the interface 305 for selecting an imageincludes only a recommended image but does not include an image that isnot recommended. For example, the image that is not recommended may behidden. Certainly, still as shown in FIG. 3B (c), the interface 305 forselecting an image includes a “view more” control. When the mobile phone100 detects that the control is triggered, the mobile phone 100 displaysmore thumbnails.

For another example, as shown in FIG. 3B (d), the interface 305 forselecting an image includes an “image type” control. When the “imagetype” control is triggered, the mobile phone 100 displays a plurality ofoptions, namely, an “image you like” option 311, a “favorite image”option 312, an “image suitable to be published” option 313, and an“image suitable to be sent to another contact” option 314. Assuming thatthe option 311 is selected, the mobile phone 100 displays only an imageof “you like”. As shown in FIG. 3B (d), the mobile phone 100 displaysonly the image 306 and the image 308.

For another example, as shown in FIG. 3B (e), different types of imagesare displayed in different regions in the interface 305 for selecting animage. An image a user likes is displayed in a first region. An imagesuitable to be published is displayed in a second region. In someembodiments, there may be a same image in images the user likes andimages suitable to be published.

In FIG. 3A (a) to FIG. 3A (d) and FIG. 3B (a) to FIG. 3B (e), Moments ofWeChat is used as an example. In an actual application, a similar mannermay also be used for another social platform (for example, a Weiboapplication, Xiaohongshu, Facebook, or Twitter), and details are notdescribed again.

In Scenario 2, when detecting an operation used to publish an image on asocial platform, the mobile phone 100 may display an image of “suitableto be published” or an image of “you like” or display differentidentification information for different types of images (for example, afirst identifier is displayed for an image of “suitable to bepublished”, and a second identifier is displayed for an image of “youlike”), so that the user quickly searches for an image. In addition,types of images are obtained by the mobile phone 100 by performingclassification based on operation behaviors of the user on the images.Therefore, image type classification complies with an operation habit ofthe user, so that user experience is improved.

Scenario 3: Instant Messaging Application

As shown in FIG. 4A (a), a mobile phone 100 displays an interface 401 ofa messages application, and the interface 401 is a communicationinterface between a user and another contact. The interface 401 includesa control 402. When detecting that the control 402 is triggered, themobile phone 100 displays a “gallery” control 403 and a “photograph”control 404.

In an example, when detecting that the user triggers the “gallery”control 403, the mobile phone 100 displays an interface 405 shown inFIG. 4A (b). The interface 405 includes thumbnails of a plurality ofimages. A mark 407 is set on an image 406 to indicate that the image 406is an image of “you like”, and a mark 412 is set on an image 411 toindicate that the image 411 is an image of “you like”. Alternatively,the mark 407 is used to indicate that the image 406 is an image of“suitable to be sent to another contact”, and the mark 412 is used toindicate that the image 411 is an image of “suitable to be sent toanother contact”. Alternatively, different marks are displayed on theimage 406 and the image 411. It is assumed that a first mark isdisplayed on the image 406, a second mark is displayed on the image 411,the first mark is used to indicate that the image 406 is an image of“you like”, and the second mark is used to indicate that the image 411is an image of “suitable to be sent to another contact”. Assuming thatthe mobile phone 100 detects that the image 406 is selected, and thendetects an operation of triggering a “send” control 408 by the user, themobile phone 100 sends the image 406 to a contact, and the mobile phone100 displays an interface 409 shown in FIG. 4A (c). A mark is notdisplayed on an image 410 in the interface 409.

In some embodiments, the mobile phone 100 may determine an image type of“suitable to be sent to a specified contact”. The specified contact mayinclude a specified type of contact, a certain specified contact, or thelike. The specified type of contact may be contacts belonging to a samegroup. Taking a WeChat application as an example, the specified type ofcontact may be all contacts belonging to a same WeChat chat group in theWeChat application, all contacts belonging to a same group (for example,family) in the WeChat application, or all contacts whose name remarksinclude a common word (for example, teacher) in the WeChat application.The certain specified contact may be a specific contact, and theelectronic device may determine, based on name remarks of a contact,whether the contact is a specified contact. For example, the specifiedcontact may include a contact whose name remarks are “father” and acontact whose name remarks are “mother”. For example, if the mobilephone 100 learns that some images (for example, scenic images orportraits) are sent to a specified contact for a relatively largequantity of times, the mobile phone 100 determines that the imagesbelong to “suitable to be sent to a specified contact”. When the mobilephone 100 displays an interface (for example, a chat interface of WeChator a chat interface of messages) for chatting with a specified contact,when detecting an operation used to send an image, the mobile phone 100displays an image suitable to be sent to the specified contact. Foranother example, if the mobile phone 100 detects that a scenic image issent to a contact whose name remarks are “father” or “mother” for arelatively large quantity of times, the mobile phone 100 determines thatan image suitable to be sent to “father” or “mother” is a scenic image,or if the mobile phone 100 learns that a portrait is sent to a contactwhose name remarks are “Amy” for a relatively large quantity of times,the mobile phone 100 determines that an image suitable to be sent to Amyis a portrait. When the mobile phone 100 displays an interface forchatting with “father” or “mother” or a group including “father” and/or“mother”, when the mobile phone 100 detects an operation used to send animage, the mobile phone 100 may display a thumbnail of an image suitableto be sent to “father” or “mother”.

In other examples, as shown in FIG. 4B (a), in the interface 405, a sizeof a thumbnail (for example, the image 406 and the image 411) of animage of “you like” or an image of “suitable to be sent to anothercontact” is greater than a size of a thumbnail of another image.

For another example, as shown in FIG. 4B (b), in the interface 405, anedge of a thumbnail (the image 406 and the image 411) of an image of“you like” or an image of “suitable to be sent to another contact” isbold, and an edge of another image is bold.

For another example, as shown in FIG. 4B (c), the interface 405 includesonly thumbnails of two images. The two images are images of “you like”or images of “suitable to be sent to another contact” or an image of“you like” and an image of “suitable to be sent to another contact”selected by the mobile phone 100 from a large quantity of images in agallery. In this example, the interface 405 does not include anotherimage. Certainly, still as shown in FIG. 4B (c), the interface 405includes a “view more” control. When the mobile phone 100 detects anoperation on the control, the mobile phone 100 displays more thumbnails.

For another example, as shown in FIG. 4B (d), the interface 405 includesan “image type” control. When the “image type” control is triggered, themobile phone 100 displays a plurality of options, namely, an “image youlike” option, a “favorite image” option, an “image suitable to bepublished” option, and an “image suitable to be sent to another contact”option. Assuming that the “image suitable to be sent to another contact”option is selected, the mobile phone 100 displays only an image suitableto be sent to another contact.

It should be understood that in FIG. 4A (a) to FIG. 4A (c), the messagesapplication is used as an example. A similar manner may be used foranother instant messaging application, and details are not describedagain.

It should be noted that in the embodiment shown in FIG. 4A (a) to FIG.4A (c), when detecting an operation used to send an image to anothercontact, the mobile phone 100 may display an image of “suitable to besent to another contact” or an image of “you like” or display differentidentification information for different types of images (for example, afirst identifier is displayed for an image of “suitable to be sent toanother contact”, and a second identifier is displayed for an image of“you like”), so that the user quickly searches for an image. Inaddition, types of images are obtained by the mobile phone 100 byperforming classification based on operation behaviors of the user onthe images. Therefore, image type classification complies with anoperation habit of the user, so that user experience is improved.

Scenario 4: Image Photographing

As shown in FIG. 5A (a), a mobile phone 100 displays a home screen 501,and the home screen 501 includes application icons of a plurality ofapplications. When the mobile phone 100 detects that a user triggers anicon 502 of a camera application, the mobile phone 100 displays aninterface 503 of the camera application, as shown in FIG. 5A (b).

In an example, as shown in FIG. 5A (b), the interface 503 of the cameraapplication includes a preview image. The preview image is an imagecaptured by the mobile phone 100 based on a preset photographingparameter of the camera, and the preset photographing parameter may be aphotographing parameter obtained by the mobile phone 100 throughanalysis based on an image the user likes. For example, if the mobilephone 100 learns that an image the user likes is relatively bright, themobile phone 100 adjusts the photographing parameter of the camera, forexample, increases an exposure value. Therefore, in this manner, afterthe mobile phone 100 starts the camera application, the mobile phone 100captures an image by using the preset photographing parameter bydefault. In this way, the photographed image is more likely to be animage the user likes.

In another example, as shown in FIG. 5B (a), the interface 503 of thecamera application includes a control 504. When the mobile phone 100detects that the control 504 is triggered, prompt information 505 isdisplayed in the interface 503. The prompt information 505 is used toindicate, to the user, that the mobile phone 100 takes a photograph byusing an image the user likes as a template. The mobile phone 100adjusts a photographing parameter to a photographing parameter obtainedthrough analysis based on an image the user likes.

In still another example, as shown in FIG. 5B (b), the interface 503 ofthe camera application includes a control 504. When the mobile phone 100detects that the control 504 is triggered, a photographing modeselection box is displayed in the interface 503, and the photographingmode selection box includes controls corresponding to a plurality ofphotographing modes, including a “use an image you like as a template”control 505. When the mobile phone 100 detects that the control 505 istriggered, the mobile phone 100 adjusts a photographing parameter to aphotographing parameter obtained through analysis based on an image theuser likes.

In still another example, as shown in FIG. 5B (c), the interface 503 ofthe camera application includes a “glow stick” control 504. When themobile phone 100 detects that the “glow stick” control 504 is triggered,the mobile phone 100 displays one or more options such as a “use animage you like as a template” option 505. When the mobile phone 100detects that the option 505 is selected, the mobile phone 100 adjusts aphotographing parameter to a photographing parameter obtained throughanalysis based on an image the user likes.

The following embodiment describes a process in which the mobile phone100 classifies stored images into two image types of “you like” and “youdislike”.

FIG. 6 is a schematic flowchart of image classification according to anembodiment of this application. As shown in FIG. 6, the process mayinclude the following steps.

S601: A mobile phone 100 detects operation behaviors on images, wherethe operation behavior includes a behavior such as deleting, viewing,sharing, collecting, or editing the image.

Assuming that the mobile phone 100 stores a relatively large quantity ofimages, where some images are viewed by a user for a relatively largequantity of times, some images are edited (for example, are retouched byusing retouching software), some images are to be deleted by the user orhave not been viewed by the user for a long time, and the like, themobile phone 100 may collect statistics on operation behaviors on allimages.

For example, Table 1 is an example of operation behaviors, on theimages, whose statistics are collected by the mobile phone 100.

TABLE 1 Image identifier Behavior Image ID1 View the image three times aday Image ID2 WeChat moment Image ID3 Delete Image ID4 View the image 0times a day

S602: The mobile phone 100 classifies the images into images of “youlike” and images of “you dislike” based on the operation behaviors.

It should be understood that the mobile phone 100 classifies the imagesin a plurality of manners. For example, the mobile phone 100 mayclassify images in a gallery into images of “you like” and an image typeof “you dislike” through artificial intelligence (artificialintelligence, AI) learning (for example, using an AI model), and thenadds a “like” label to the images of “you like” and adds a “dislike”label to images of “you dislike”.

For example, if the operation behavior is viewing, the mobile phone 100may mark, as an image the user likes, an image that has been viewed formore than a preset quantity of times, and mark, as an image the userdislikes, an image that has been viewed for the preset quantity of timesor less than the preset quantity of times. For example, if the operationbehavior is sharing, the mobile phone 100 may mark, as an image the userlikes, an image that has been shared for a preset quantity of times, andmark, as an image the user dislikes, an image that has been shared forthe preset quantity of times or less than the preset quantity of times.

For example, Table 2 is an example of favorability that is of the userfor each image and that is determined by the mobile phone 100.

TABLE 2 Image identifier Behavior Favorability Image ID1 View the imagethree times a day Like Image ID2 Share the image on social software LikeImage ID3 Delete Dislike Image ID4 View the image 0 times a day Dislike

It should be noted that the favorability may be indicated by “yes” or“no”, where “yes” indicates “like”, and “no” indicates “dislike”; or thefavorability may be indicated by a score. A higher score indicateshigher favorability, and a lower score indicates lower favorability. Thescore may be measured by using a 10-point scoring system, a 100-pointscoring system, or the like, and this is not limited in this embodimentof this application.

The following embodiment describes a process in which the mobile phone100 classifies images into image types of “you like” and “you dislike”by using an AI model.

In some embodiments, the model may be, for example, a neural networkunit, a machine learning model, or the like. Generally, the model mayinclude a model parameter. The mobile phone 100 may obtain an outputresult by using an input parameter, the model parameter, and a relatedalgorithm. The output result may be a class label. FIG. 7 shows anexample of an algorithm related to a model parameter:

$\begin{matrix}\left\{ {\begin{matrix}{u = {{\sum_{i = 1}^{n}{w_{i}x_{i}}} + b}} \\{y = {f(u)}}\end{matrix},} \right. & (1)\end{matrix}$

wherex₁ and x₂ to x_(n) are a plurality of input parameters, w₁ and w₂ tow_(n) are coefficients (also referred to as weights) of the inputparameters, b is an offset (used to indicate an intercept between u anda coordinate origin) of each input parameter, and f is used to ensurethat a value range of an output result is a function (for example, aSigmoid function or a tan h function) in an interval [0, 1]. In someembodiments, an input parameter is x, model parameters are the weightw_(i) and the offset b, and an output parameter is y. When w, b, and xhave specific values, the output result y may be obtained by using theforegoing formula. It should be noted that FIG. 7 is only an example ofa model for ease of understanding, and is not a limitation on the modelof this application.

It should be understood that, in this embodiment of this application,the input parameter x is one or more images (referred to as input imagesbelow). When a model parameter is determined, an output result may beobtained by using a model related algorithm, and the output result maybe class labels to which the one or more input images belong. Forexample, the class label may be “you like” or “you dislike”. A model useprocess may be as follows: One or more images are used as inputparameters, and a model parameter (for example, a trained modelparameter) is used to run a model related algorithm to obtain an outputresult. The output result may be a label of the input image. Forexample, the output result is “yes” or “no”. In some embodiments, theoutput result may be obtained based on a probability that the inputimage belongs to a “like” label (or a probability that the input imagebelongs to a “dislike” label). For example, when a probability that animage belongs to the “like” label is 0.9, the mobile phone 100 maydetermine that the input image belongs to the “you like” class label,and the output result may be “yes”.

It should be noted that there is a “training process” and a “useprocess” for using a model. The model training process is a process ofdetermining a model parameter. The following embodiment describes themodel training process. Refer to FIG. 8. A procedure of the modeltraining process may include the following steps.

S801: Obtain a group of associated images.

In some embodiments, a group of “associated” images may be at least twoimages, and “associated” may mean that a group of images are associatedin terms of content, photographing times, photographing places, or thelike. In an example, if a mobile phone 100 continuously photographsthree images, the three images are a group of associated images. Inother examples, the mobile phone 100 photographs three images of a sameobject, in other words, the three images include the same object (whichmay also be referred to as a photographed object), the three images arealso a group of associated images. In still another example, the mobilephone 100 photographs three images within specific duration (forexample, within 30 minutes), the three images may be a group ofassociated images.

S802: Detect an operation behavior on a first image in the group ofimages.

A user may perform different operations on images in a group ofassociated images. For example, a group of associated images includethree images including a same person. When the mobile phone 100 detectsan image publishing operation on one of the images (for example,publishing the image to Moments of WeChat), the mobile phone 100determines that the image belongs to an image type of “suitable to bepublished”. The mobile phone 100 may add a label such as a “suitable tobe published” label to the image.

S803: Add a label to the first image based on the operation behavior.

It should be understood that the mobile phone 100 may determine an imagetype of an image in a group of associated images based on an operationbehavior of the user on the image, and further add a suitable label tothe image.

S804: Use the first image as an input parameter, determine an initialmodel parameter, and run an algorithm related to the model parameter toobtain an output result, where the output result may be the label of thefirst image.

S805: Determine whether the output result is the same as the label thatis of the first image and that is determined in S803; and if yes, endthe training; or if no, perform S806.

S806: Adjust the model parameter.

S807: Use the first image as the input parameter, and run, by using anadjusted model parameter, an algorithm related to the model parameter toobtain a new output result.

Taking FIG. 7 as an example, a model training process is a process ofdetermining w_(i) and b when x_(i) and y are known. In some embodiments,when x_(i) is known, initial w₀ and b₀ are determined, Formula (1) iscalculated to obtain y₀, and it is determined, through comparison,whether a difference between y₀ and known y is relatively small. If yes,the model training is completed. If no, initial w₀ and b₀ are adjusted,for example, adjusted to w₁ and b₁, then Formula (1) is calculated againto obtain y₁ when x_(i), w₁, and b₁ are known, and a difference betweeny₁ and known y is determined through comparison. The model training endsuntil a difference between obtained y_(n) and known y is relativelysmall.

S808: Determine whether the output result is the same as the label thatis of the first image and that is determined in S803; and if yes, endthe training; or if no, perform S806.

For example, the mobile phone 100 photographs two associated images. Themobile phone 100 detects that the user publishes the first image toMoments, but does not publish the second image. In this case, a label ofthe first image is “image you like”, and a label of the second image is“image you dislike”. The mobile phone 100 uses the first image as apositive training set, and uses the second image as a negative trainingset.

The mobile phone 100 uses the first image and the second image as inputparameters, and runs a model related algorithm by using a modelparameter to obtain a first output result and a second output result. Ifthe first output result indicates that the first image is an image theuser likes, and the second output result indicates that the second imageis an image the user dislikes, in other words, the first output resultis consistent with the label of the first image, and the second outputresult is consistent with the label of the second image, the mobilephone 100 does not need to adjust the model parameter. When the firstoutput result is inconsistent with the label of the first image, or thesecond output result is inconsistent with the identifier of the secondimage, the model parameter is adjusted until the first output result isconsistent with the label of the first image, and the second outputresult is consistent with the identifier of the second image, in otherwords, the model training ends.

In the foregoing process, a label used in the model training process ofthe mobile phone 100 is “image you like” or “label you dislike”, andtherefore a trained model parameter is used to classify images into atype of “you like” and a type of “you dislike”. In some embodiments, oneor more models may be stored in the mobile phone 100, and if a pluralityof models are stored, the models may have different functions. Forexample, one model is used to classify images into a type of “you like”or “you dislike”, and another model is used to classify images into atype of “suitable to be published” or “unsuitable to be published”.

In some embodiments, after the model training ends, a model use processincludes: The mobile phone 100 uses one or more images as inputparameters of a model, and when model parameters (which are determinedin the model training process, and are, for example, w_(i) and b) areknown, runs a model related algorithm to determine an output result. Theoutput result is class labels of the one or more input images.

In some embodiments, the mobile phone 100 may periodically train a modelor classify images by using a model, or may train a model or classifyimages by using a model when the mobile phone 100 is idle (for example,the user has not operated the mobile phone 100 for a relatively longtime). This is not limited in this embodiment of this application.

The following describes some examples in which the mobile phone 100classifies images into “you like” or “you dislike” by using an AI model.

EXAMPLE 1

A mobile phone 100 photographs three images. As shown in FIG. 9A, a userdeletes the first two images, and retains the third image (or a userviews the third image for a relatively large quantity of times, andviews the first two images for a relatively small quantity of times, orthe third image is modified (for example, retouched), and the first twoimages are not modified, or the like). The mobile phone 100 detectsdifferent operation behaviors of the user on the three images, and maydetermine that the user likes the third image, and then use the firsttwo images as a positive training set and use the third image as anegative training set to train an AI model to obtain a trained model.Based on the trained model, an image whose image background includes arelatively small quantity of persons may be classified as an image theuser likes, and an image whose image background includes a relativelylarge quantity of persons may be classified as an image the userdislikes.

If the mobile phone 100 photographs an image again, the mobile phone 100may input the image into the AI model, and run the AI model to performcalculation. If it is determined that a background of the image includesa relatively small quantity of persons, a result “yes” is output, or ifa background of the image includes a relatively large quantity ofpersons, a result “no” is output, where “yes” is used to indicate thatthe user likes the image, and “no” is used to indicate that the userdislikes the image.

Optionally, for an image the user likes, the mobile phone 100 displaysan identifier on a thumbnail of the image. For an image whose outputresult is “no”, the mobile phone 100 may output prompt information toindicate the user to delete the image.

EXAMPLE 2

A mobile phone 100 photographs three images. As shown in FIG. 9B, a userdeletes the first two images, and retains the third image. The mobilephone 100 detects different operation behaviors of the user on the threeimages, and may determine that the user likes the third image, and thenuse the first two images as a positive training set and use the thirdimage as a negative training set to train an AI model to obtain atrained model. Based on the trained model, an image including nowatermark may be classified as an image the user likes, and an imageincluding a watermark may be classified as an image the user dislikes.

After the mobile phone 100 photographs an image again, the mobile phone100 inputs the image into the AI model, and runs the AI model to performcalculation. If it is determined that the image includes no watermark, aresult “yes” is output, or if the image includes a watermark, a result“no” is output, where “yes” is used to indicate that the user likes theimage, and “no” is used to indicate that the user dislikes the image.

EXAMPLE 3

A mobile phone 100 photographs three images. As shown in FIG. 9C, a userdeletes the first two images, and retains the third image. The mobilephone 100 detects different operation behaviors of the user on the threeimages, and may determine that the user likes the third image, and thenuse the first two images as a positive training set and use the thirdimage as a negative training set to train an AI model to obtain atrained model. Based on the trained model, an image on which there is ashadow on a face of a person may be classified as an image the userlikes, and an image on which there is no shadow on a face of a personmay be classified as an image the user dislikes.

After the mobile phone 100 photographs an image again, the mobile phone100 inputs the image into the AI model, and runs the AI model to performcalculation. If it is determined that there is no shadow on a face of aperson on the image, a result “yes” is output, or if there is a shadowon a face of a person on the image, a result “no” is output, where “yes”is used to indicate that the user likes the image, and “no” is used toindicate that the user dislikes the image.

EXAMPLE 4

A mobile phone 100 photographs three images. As shown in FIG. 9D, a userdeletes the first two images, and retains the third image. The mobilephone 100 detects different operation behaviors of the user on the threeimages, and may determine that the user likes the third image, and thenuse the first two images as a positive training set and use the thirdimage as a negative training set to train an AI model to obtain atrained model. Based on the trained model, an image with moderatebrightness and relatively high definition may be classified as an imagethe user likes, and an excessively bright or dim image with relativelylow definition may be classified as an image the user dislikes.

After photographing an image again, the mobile phone 100 inputs theimage into the AI model, and runs the AI model to perform calculation.If it is determined that the image has relatively high definition andmoderate brightness, a result “yes” is output, or if the image isrelatively bright or relatively dim and has relatively low definition, aresult “no” is output, where “yes” is used to indicate that the userlikes the image, and “no” is used to indicate that the user dislikes theimage.

EXAMPLE 5

A selfie is used as an example. A person always takes selfies at aplurality of angles. For example, a face turns to the left by 60°, theface turns to the left by 30°, the face faces the front, the face turnsto the right by 30°, and the face turns to the right by 60°. Generally,after photographing a plurality of images, the user performs screeningto retain a selected image and delete another images, or the user mayshare, collect, or repeatedly view an image, or the like. When detectingdifferent operation behaviors of the user on the plurality of images, amobile phone 100 may determine an image the user likes (for example,determine that a shared image, a retained image, or a collected image isan image the user likes). For example, the mobile phone 100 determines,through AI learning, that a face angle on the image the user likes isusually 60 degrees by which the face turns to the left.

When the user takes a selfie again by using the mobile phone 100, if themobile phone 100 determines that a face angle on the image is 60 degreesby which the face turns to the left, the mobile phone 100 may advise theuser to retain the image (or may indicate, to the user, that the imagecan be shared). If the mobile phone 100 determines that a face angle onthe image is not 60 degrees by which the face turns to the left, themobile phone 100 may indicate the user to delete the image.

Example 5 merely uses a face angle in a selfie as an example. In anactual application, the mobile phone 100 may further learn a facialexpression, a posture, a position in a group photo, and the like in animage the user likes. It is assumed that the facial expression is asmile, the posture is standing, or the user is in a middle position onthe image the user likes. After the mobile phone 100 photographs animage, if it is determined that a facial expression on the image is asmile, a posture is standing, or the user is in a middle position, themobile phone 100 retains the image (or may indicate, to the user, thatthe image can be shared, or the like).

The foregoing lists four processes in which the mobile phone 100 learns,based on operation behaviors of the user on images, images belonging toa type of “you like”. In an actual application, the mobile phone 100 mayperform learning based on any one or more of the foregoing manners, andthis is not limited in this embodiment of this application.

It should be noted that, when identifying an image of “you dislike” byusing the AI model, the mobile phone 100 may output prompt informationto indicate the user to delete the image, or automatically delete theimage. Alternatively, after detecting that images are backed up to thecloud, the mobile phone 100 automatically deletes all images whoselabels are “you dislike”. Alternatively, after detecting that images arebacked up to the cloud, the mobile phone 100 outputs prompt informationto indicate, to the user, whether to delete an image whose label is “youdislike”. Alternatively, after detecting that images are backed up tothe cloud, the mobile phone 100 displays a control, and when the controlis triggered, the mobile phone 100 deletes all images whose labels are“you dislike”.

The following embodiment describes a process in which the mobile phone100 classifies images into “suitable to be published” and “unsuitable tobe published”.

Similarly, the mobile phone 100 may determine, by using an AI model,images belonging to “suitable to be published” and images belonging to“unsuitable to be published”.

The mobile phone 100 detects first feature information of a publishedimage in stored images. When obtaining an image, the mobile phone 100determines whether second feature information of the image meets thefirst feature information. If the second feature information meets thefirst feature information, the mobile phone 100 adds a “suitable to bepublished” label to the image; or if the second feature information doesnot meet the first feature information, the mobile phone 100 adds an“unsuitable to be published” label to the image. For example, the mobilephone 100 detects that a scenic image in stored images is published.After the mobile phone 100 obtains an image, if the image is a scenicimage, the mobile phone 100 adds the “suitable to be published” label tothe image.

It should be noted that, in this embodiment of this application, thelabel may be alternatively “you like and suitable to be published”, “youlike but unsuitable to be published”, “you dislike but suitable to bepublished”, or “you dislike and unsuitable to be published”. In otherwords, when a label of an image is identified by using a model, aplurality of types of the image may be identified. This is not limitedin this embodiment of this application.

When detecting an operation used to publish an image, the mobile phone100 recommends an image whose label is “suitable to be published” to auser. Taking FIG. 3A (b) as an example, when detecting an operation oftriggering the “select an image from the gallery” option 304 by theuser, the mobile phone 100 displays thumbnails of a plurality of images.Marks are displayed on thumbnails of some images, and the mark is usedto indicate that the image belongs to an image type of “suitable to bepublished”.

The following describes examples in which the mobile phone 100classifies images into “suitable to be published” or “unsuitable to bepublished”.

EXAMPLE 6

Three images are stored in a mobile phone 100, the first two images arepublished (or have been published for a relatively large quantity oftimes), and the third image is not published (or has been published fora relatively small quantity of times). The mobile phone 100 detectsdifferent operation behaviors of a user on the three images, and maydetermine that the first two images are images suitable to be publishedand the third image is not published or shared, and then use the firsttwo images as a positive training set and use the third image as anegative training set to train an AI model to obtain a trained model.Based on the trained model, the mobile phone 100 may determine whetheran input image meets a condition of being suitable to be published (forexample, whether the input image meets feature information of apublished image). If the input image meets the condition, the mobilephone 100 classifies the image under the “suitable to be published”class label; or if the input image does not meet the condition, themobile phone 100 classifies the image under the “unsuitable to bepublished” class label.

After photographing an image again, the mobile phone 100 inputs theimage into the AI model, and runs the AI model to perform calculation.If it is determined that the image meets the condition of being suitableto be published, the mobile phone 100 outputs a result “yes”; or if theimage does not meet the condition of being suitable to be published, themobile phone 100 outputs a result “no”.

EXAMPLE 7

In some embodiments, a mobile phone 100 may divide a moving image into aplurality of static images at a time interval of 100 ms (the value isused as an example, and this is not limited in this embodiment of thisapplication), and input each static image into an AI model to obtain anoutput result of each image, for example, a probability that each imagebelongs to a “you like” class label. The mobile phone 100 selects, fromthe static images, an image with a highest probability as a cover of themoving image.

The following describes a process in which the mobile phone 100classifies images into “suitable to be sent to a contact” and“unsuitable to be sent to a contact”.

Similarly, the mobile phone 100 may determine, by using an AI model,images belonging to “suitable to be sent to a contact” and imagesbelonging to “unsuitable to be sent to a contact”.

In some embodiments, the mobile phone 100 detects first featureinformation of an image that is in stored images and that is sent to oneor more contacts (which may be any contact). When obtaining an image,the mobile phone 100 determines whether second feature information ofthe image meets the first feature information. If the second featureinformation meets the first feature information, the mobile phone 100adds a “suitable to be sent to a contact” label to the image; or if thesecond feature information does not meet the first feature information,the mobile phone 100 adds an “unsuitable to be sent to a contact” labelto the image. For example, the mobile phone 100 detects that an imageobtained by the mobile phone by taking a screenshot in stored images issent to a contact. After the mobile phone 100 obtains an image, if theimage is an image obtained by the mobile phone 100 by taking ascreenshot, the mobile phone 100 adds the “suitable to be sent to acontact” label to the image.

When detecting an operation used to send an image to another contact,the mobile phone 100 recommends an image whose label is “suitable to besent to a contact” to a user. Taking FIG. 4A (a) as an example, whendetecting an operation of triggering the image 403 by the user, themobile phone 100 displays a plurality of images. Icons are displayed onthumbnails of some images, and the icon is used to indicate that theimage is suitable to be sent to a contact.

In other embodiments, the mobile phone 100 may further determine, byusing the AI model, images belonging to “suitable to be sent to aspecified contact”. The specified contact may include a specified typeof contact, a certain specified contact, or the like. The specified typeof contact may be contacts belonging to a same group. Taking a WeChatapplication as an example, the specified type of contact may be allcontacts belonging to a same WeChat chat group in the WeChatapplication, all contacts belonging to a same group in the WeChatapplication, or all contacts whose name remarks include a common word(for example, teacher) in the WeChat application. The certain specifiedcontact may be a specific contact, and the electronic device maydetermine, based on name remarks of a contact, whether the contact is aspecified contact. For example, the mobile phone 100 may detect firstfeature information of an image sent to a specified contact (forexample, a parent) in all stored images. When obtaining an image, themobile phone 100 determines whether second feature information of theimage meets the first feature information. If the second featureinformation meets the first feature information, the mobile phone 100adds a “suitable to be sent to a specified contact” label to the image.

The implementations of this application may be combined randomly toachieve different technical effects.

With reference to the foregoing embodiments and related accompanyingdrawings, an embodiment of this application provides an image displaymethod. The method may be implemented in the mobile phone 100 shown inFIG. 1A or another electronic device. As shown in FIG. 10, the methodmay include the following steps.

1001: Detect an input operation.

In an example, taking FIG. 3A (b) as an example, the input operation maybe an operation of tapping the “select an image from the gallery”control 304.

1002: Display an image selection interface on a display in response tothe input operation.

In some embodiments, the image selection interface (which may also bereferred to as an interface for selecting an image) is an interface thatcan display thumbnails of a plurality of images for selection by a user,for example, the interface 203 in FIG. 2B (a) to FIG. 2B (d) or theinterface 305 in FIG. 3B (a) to FIG. 3B (e).

1003: Determine at least one image related to the input operation from agroup of associated images in a local memory or a cloud storage.

In some embodiments, the local memory may be a memory inside theelectronic device. An image in the cloud storage may be an image storedon a cloud server by the electronic device.

In some embodiments, the group of associated images include a group ofimages including a same photographed object, for example, three imagesshown in FIG. 9C, and/or a group of images whose photographing timedifference is less than a preset time difference, and/or a group ofimages photographed at a same place, and/or a group of images belongingto a same album, and/or a group of images including same content buthaving different resolution, and/or a group of images obtained after asame image is retouched in different manners.

In some embodiments, the electronic device may determine an image typeof each image based on an operation behavior of the user on the image.For example, the electronic device obtains a group of associated images,detects an operation behavior on each of the group of images, where theoperation behavior includes one or more of deleting, retaining,retouching, image publishing, and sending an image to a contact, anddetermines an image type of each image based on the operation behavior.The image type includes an image type of “suitable to be published” andan image type of “suitable to be sent to another contact”.

For example, if the electronic device obtains the three images shown inFIG. 9C, and determines that the third image in the images is publishedon a social platform, the electronic device determines that the thirdimage belongs to the type of “suitable to be published”.

For another example, if the electronic device obtains three images shownin FIG. 9A, and determines that the third image in the images is sent toanother contact, the electronic device determines that the third imagebelongs to the type of “suitable to be sent to another contact”.

In a possible implementation, the electronic device may determine anoperation type of the input operation, and determines, based on theoperation type, at least one image associated with the operation type.In an example, the electronic device determines that the input operationis an operation used to publish an image, and determines, based on theoperation type, at least one image suitable to be published. In otherwords, after detecting the operation used to publish an image, theelectronic device may display only a thumbnail of the determined imagesuitable to be published, to help the user perform selection. In otherexamples, the electronic device determines that the input operation isan operation of communicating with another contact, and determines,based on the operation type, at least one image suitable to be sent toanother contact. In other words, when detecting the operation used tosend an image to another contact, the electronic device may display onlya thumbnail of the image suitable to be sent to another contact, to helpthe user have a view.

In some embodiments, the at least one image suitable to be published mayinclude at least one image that has been published, and may furtherinclude an image of a same type as the image that has been published.For example, if the at least one image that has been published is aportrait (for example, an area of a person on the image is relativelylarge), an image of a portrait type is an image suitable to bepublished. For another example, if the at least one image that has beenpublished is an image on which leg extension processing is performed,the electronic device determines that an image on which leg extensionprocessing is performed is an image suitable to be published. The atleast one image suitable to be published may further include at leastone image that has been retouched for a preset quantity of times.

In some embodiments, the at least one image suitable to be sent toanother contact includes an image including the another contact, and mayfurther include an image of a same type as an image that has been sentto the another contact. For example, if an image that has been sent to acontact is a mobile phone screenshot, an image obtained by the mobilephone by taking a screenshot is an image suitable to be sent to thecontact.

In another possible implementation, the electronic device determinesrelated information of an application to which the input operationrelates, and determines, based on the related information of theapplication, at least one image associated with the related informationof the application.

In an example, the electronic device may determine a type or a functionof the application to which the input operation relates, and determine,based on the type or the function of the application, at least one imagematching the type or the function.

For example, if the application to which the input operation relates isthe Baihe Network, the electronic device determines that at least oneimage matching the application is at least one selfie. For anotherexample, if the application to which the input operation relates is agame application, the electronic device determines that at least oneimage matching the application is an image of at least one game image.

In other examples, the electronic device may alternatively determine ahistorical record of publishing or sharing an image by the applicationto which the input operation relates, and determine, based on thehistorical record of the application, at least one image matching thehistorical record.

For example, if the electronic device detects that an image published bythe user last time through Moments of WeChat is from a “My” album, theelectronic device determines, based on the historical record, that theat least one image is at least one image in the “My” album.

In another possible case, the electronic device may alternativelydetermine time information corresponding to the input operation, anddetermine, based on the time information, at least one image matchingthe time information. The time information may include date information,moment information (for example, 12:10), and the like.

For example, if the electronic device determines that current timeinformation is May 1, the electronic device may determine that at leastone image corresponding to the time information is at least one imagephotographed on May 1, at least one image published/shared on May 1 lastyear, or at least one image including 5.1.

In some embodiments, before 1001, that is, before the electronic devicedetects the input operation, the electronic device may preset anassociated image of each type of input operation. For example, for aninput operation used to send an image to a contact, the electronicdevice determines that an associated image of the input operation is aspecified image such as an image that has been retouched for arelatively large quantity of times, or for an input operation used topublish an image on a social platform, the electronic device determinesthat an associated image of the input operation is a specified imagesuch as an image with an extended leg. Therefore, after detecting aninput operation, the electronic device determines, based on a presetimage associated with the input operation, at least one image associatedwith the detected input operation.

1004: Display a thumbnail of the at least one image in the imageselection interface, and hide another image.

In an example, taking FIG. 3B (b) and FIG. 3B (c) as examples, only athumbnail of a selected image related to the input operation isdisplayed in the image selection interface, and a thumbnail of anotherimage is not displayed. For example, if a group of images include threeimages, and the electronic device selects an image associated with aninput operation, only the image is displayed in the image selectioninterface, and the other two images are not displayed.

Optionally, the electronic device may further display markinginformation in the image selection interface, where the markinginformation is used to indicate that the at least one image is relatedto the input operation. In an example, the electronic device displaysthe marking information on a thumbnail of each of the at least oneimage, for example, displays marks on the thumbnail 204 and thethumbnail 206 in FIG. 2A (a) to FIG. 2A (c); or displays the markinginformation in a region in which the at least one image is not displayedin the image selection interface.

Optionally, the marking information includes one or more of an icon, atext, and an image; or the displaying the marking information on athumbnail of each of the at least one image includes: highlighting anedge of the thumbnail of each of the at least one image. For example,edges of the thumbnail 306 and the thumbnail 308 in FIG. 3B (a) to FIG.3B (e) are highlighted.

In a possible case, the electronic device may read or load all images inthe group of associated images from the local memory or the cloudstorage; determine at least one image related to the input operationfrom all the images in the group of images; and then display thethumbnail of the at least one image in the image selection interface,and not display a thumbnail of the another image in the image selectioninterface.

For example, an image is stored in the cloud storage. Taking FIG. 3B (c)as an example, the mobile phone may download all images in a group ofassociated images from the cloud storage, and display, in the interface305, only thumbnails of two images related to an input operation. Whendetecting an operation on a “view more” control, the mobile phone maydisplay a thumbnail of an image other than the two images.

In another possible case, the electronic device may read or load the atleast one image associated with the input operation from the localmemory or the cloud storage, and display the thumbnail of the at leastone image in the image selection interface; and not read or load theimage other than the at least one image in the group of images from thelocal memory or the cloud storage.

For example, an image is stored in the cloud storage. Further takingFIG. 3B (c) as an example, the mobile phone may download only two imagesrelated to an input operation from the cloud storage, and then displaythumbnails of the two images in the interface 305. When detecting anoperation on a “view more” control, the mobile phone may downloadanother image from the cloud storage, and display a thumbnail of theanother image.

In other possible cases, the electronic device may alternatively preloadonly the thumbnail of the at least one image from the local memory orthe cloud storage, and not preload a thumbnail of the image other thanthe at least one image in the group of images; and then display thethumbnail of the at least one image in the image selection interface.

For example, an image is stored in the cloud storage. Further takingFIG. 3B (c) as an example, the mobile phone may preload only thumbnailsof two images related to an input operation from the cloud storage, andmay not need to fully download original images of the two images(definition of the thumbnail is lower than definition of the originalimage) or to preload a thumbnail of another image. The mobile phone maydisplay the thumbnails of the two images in the interface 305. Whendetecting an operation on a “view more” control, the mobile phone maypreload the thumbnail of the another image from the cloud storage, anddisplay the thumbnail of the another image.

1005: Detect a first operation, where the first operation is used toselect a first thumbnail in the image selection interface.

1006: Perform, on the first thumbnail, a processing procedurecorresponding to the input operation.

In some embodiments, the input operation may be an operation used topublish an image. In this case, after selecting the first thumbnail, theelectronic device may perform an image publishing procedure on the firstthumbnail. Taking a Weibo application as an example, the imagepublishing procedure may include: The electronic device sends an imageto a server corresponding to the Weibo application, to publish the imageto a Weibo platform through the server. In other embodiments, the inputoperation may be an operation used to send an image to a contact. Inthis case, after selecting the first thumbnail, the electronic devicemay send an image corresponding to the first thumbnail to the contact.

In the foregoing embodiments provided in this application, the methodprovided in the embodiments of this application is described from aperspective that the electronic device (the mobile phone 100) serves asan execution subject. To implement functions in the method provided inthe embodiments of this application, the terminal device may include ahardware structure and/or a software module, and implement the functionsin a form of the hardware structure, the software module, or both thehardware structure and the software module. Whether a specific functionof the foregoing functions is performed by using the hardware structure,the software module, or the combination of the hardware structure andthe software module depends on a particular application and a designconstraint of the technical solution.

According to the context, the term “when” used in the foregoingembodiments may be interpreted as a meaning of “if”, “after”, “inresponse to determining”, or “in response to detecting”. Similarly,according to the context, the phrase “when it is determined that” or “if(a stated condition or event) is detected” may be interpreted as ameaning of “if it is determined that”, “in response to determining”,“when (a stated condition or event) is detected”, or “in response todetecting (a stated condition or event)”.

All or some of the foregoing embodiments may be implemented by usingsoftware, hardware, firmware, or any combination thereof. When softwareis used to implement the embodiments, all or some of the embodiments maybe implemented in a form of a computer program product. The computerprogram product includes one or more computer instructions. When thecomputer program instructions are loaded and executed on a computer, theprocedure or functions according to the embodiments of this applicationare all or partially generated. The computer may be a general-purposecomputer, a dedicated computer, a computer network, or anotherprogrammable apparatus. The computer instructions may be stored in acomputer-readable storage medium or may be transmitted from acomputer-readable storage medium to another computer-readable storagemedium. For example, the computer instructions may be transmitted from awebsite, computer, server, or data center to another website, computer,server, or data center in a wired (for example, a coaxial cable, anoptical fiber, or a digital subscriber line) or wireless (for example,infrared, radio, or microwave) manner. The computer-readable storagemedium may be any usable medium accessible by the computer, or a datastorage device, such as a server or a data center, integrating one ormore usable media. The usable medium may be a magnetic medium (forexample, a floppy disk, a hard disk, or a magnetic tape), an opticalmedium (for example, a DVD), a semiconductor medium (for example, asolid-state drive), or the like.

For a purpose of explanation, the foregoing description is describedwith reference to a specific embodiment. However, the foregoing examplediscussion is not intended to be detailed, and is not intended to limitthis application to a disclosed precise form. Based on the foregoingteaching content, many modification forms and variation forms arepossible. Embodiments are selected and described to fully illustrate theprinciples of this application and practical application of theprinciples, so that other persons skilled in the art can make full useof this application and various embodiments that have variousmodifications applicable to conceived specific usage.

1. A method, implemented by an electronic device, wherein the methodcomprises: detecting an input operation; displaying, in response to theinput operation, an image selection interface on a display of theelectronic device; determining, from a group of associated images in alocal memory or a cloud storage, at least one first image related to theinput operation; displaying a first thumbnail of the at least one firstimage in the image selection interface; detecting a first operation ofselecting a second thumbnail in the image selection interface; andperforming, on the second thumbnail, a processing procedurecorresponding to the input operation.
 2. The method of claim 1, furthercomprising hiding a second image other than the at least one first imagein the group of associated images.
 3. The method of claim 1, furthercomprising displaying marking information indicating that the at leastone first image is related to the input operation.
 4. The method ofclaim 3, further comprising: displaying the marking information on thefirst thumbnail; or displaying the marking information in a region inwhich the at least one first image is not displayed in the imageselection interface.
 5. The method of claim 3, wherein the markinginformation comprises one or more of an icon, a text, or a second image,or wherein the method further comprises highlighting an edge of thefirst thumbnail.
 6. The method of claim 1, wherein the group ofassociated images comprises a first group of images comprising a samephotographed object, a second group of images with a photographing timedifference that is less than a preset time difference, a third group ofimages photographed at a same place, a fourth group of images belongingto a same album, a fifth group of images comprising same content buthaving different resolution, or a sixth group of images obtained after asame image is retouched in different manners.
 7. The method of claim 1,wherein before detecting the input operation, the method furthercomprises presetting an associated image of each type of inputoperation.
 8. The method of claim 1, further comprising: performing animage publishing procedure on a second image corresponding to the secondthumbnail when the input operation is publishing an image; and thesecond image to a contact when the input operation is sending the imageto the contact.
 9. The method of claim 1, further comprising:determining an operation type of the input operation; and determining,based on the operation type, at least one second image associated withthe operation type.
 10. The method of claim 9, further comprising:determining that the input operation is publishing an image; anddetermining, based on the operation type, at least one third imagesuitable to be published.
 11. The method of claim 9, further comprising:determining that the input operation is communicating with a contact;and determining, based on the operation type, at least one third imagesuitable to be sent to the contact.
 12. The method of claim 10, whereinthe at least one fourth image comprises: a fourth image of a same typeas a fifth image that has been published; or at least one sixth imagethat has been retouched for a preset quantity of times.
 13. The methodof claim 11, wherein the at least one fourth image comprises: a fourthimage comprising the contact; or a fifth image of a same type as a sixthimage that has been sent to the contact.
 14. The method of claim 1,further comprising: determining related information of an application towhich the input operation relates; and determining, based on the relatedinformation, at least one second image associated with the relatedinformation.
 15. The method of claim 14, further comprising: determininga type of the application or a function of the application; anddetermining, based on the type or the function, at least one third imagematching the type or the function.
 16. The method of claim 14, furthercomprising: determining a historical record of publishing or sharing athird image by the application; and determining, based on the historicalrecord, at least one fourth image matching the historical record. 17.The method of claim 1, further comprising: determining time informationcorresponding to the input operation; and determining, based on the timeinformation, at least one second image matching the time information.18. The method of claim 1, further comprising: reading or loading secondimages in the group of associated images from the local memory or thecloud storage; determining the at least one first image from all thesecond images; displaying the first thumbnail; and skipping displaying athird thumbnail of a third image in the image selection interface.19-20. (canceled)
 21. An electronic device, comprising: a display; amemory coupled to the display and configured to store instructions; anda processor coupled to the display and the memory, wherein when executedby the processor, the instructions cause the electronic device to:detect an input operation; display, in response to the input operation,an image selection interface on the display; determine, from a group ofassociated images in a local memory or a cloud storage, at least onefirst image related to the input operation; display a first thumbnail ofthe at least one first image in the image selection interface; detect afirst operation of selecting a second thumbnail in the image selectioninterface; and perform, on the second thumbnail, a processing procedurecorresponding to the input operation.
 22. (canceled)
 23. A computerprogram product comprising computer-executable instructions that arestored on a non-transitory computer-readable medium and that, whenexecuted by a processor, cause an electronic device to: detect an inputoperation; display, in response to the input operation, an imageselection interface on a display of the electronic device; determine,from a group of associated images in a local memory or a cloud storage,at least one first image related to the input operation; display a firstthumbnail of the at least one first image in the image selectioninterface; detect a first operation of selecting a second thumbnail inthe image selection interface; and perform, on the second thumbnail, aprocessing procedure corresponding to the input operation.